Bluetooth Low Energy in iOS Swift: Your Guide to Programming the Internet of Things by Tony Gaitatzis

Bluetooth Low Energy in iOS Swift: Your Guide to Programming the Internet of Things by Tony Gaitatzis

Author:Tony Gaitatzis [Gaitatzis, Tony]
Language: eng
Format: azw3, pdf
Publisher: BackupBrain
Published: 2017-09-27T04:00:00+00:00


Property Data Type Value

.major NSNumber iBeacon Major Number

.minor NSNumber iBeacon Minor Number

.proximityUUID UUD iBeacon Proximity UUID

For security reasons, iOS does not reveal the transmission power of an iBeacon, which can be used to determine the distance between the Central and the iBeacon.

An iBeacon's distance from the Ranging Central can be approximated using the CLBeacon.proximity property

Table 11-2. CLProximity

Value Signal Strength Approximate Distance

immediate Strong Up to a few centimeters

near Medium Up to a few meters

far Weak More than a few meters

unknown Extremely weak Impossible to determine

This can be implemented in code like this: func getProximityString(fromBeacon: CLBeacon) -> String { switch beacon.proximity {

case .unknown:

return "Unknown"

case .immediate:

return "Immediate"

case .near:

return "Near"

case .far:

return "Far"

}

}

If the transmission power of the iBeacon is known, that can be useful for determining how far away the iBeacon is.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.